package com.itheima.test6;

import java.util.Properties;
import java.util.Set;

/**
 * @Author:gy
 * @Date: 2025/08/31 16:47
 * @Description:
 */
public class Demo {
    public static void main(String[] args) {
        Properties prop = new Properties();
        //增
        prop.put("小帅","heima001");
        prop.put("小美","heima002");
        prop.put("小华","heima003");
        //特有方法
        prop.setProperty("小明","heima004");
        Set<String> set = prop.stringPropertyNames();
        for (String s : set) {
            System.out.println(s+"==="+prop.getProperty(s));
        }
        // String s = prop.getProperty("小美");
        //System.out.println(s);
        //删
        // prop.remove("小美");
        //改
        // prop.put("小美","heima004");
        //查
        /*Set<Object> set = prop.keySet();
        for (Object key : set) {
            Object value = prop.get(key);
            System.out.println(key + ":" + value);
        }*/
       /* Set<Map.Entry<Object, Object>> entries = prop.entrySet();
        for (Map.Entry<Object, Object> entry : entries) {
            System.out.println(entry.getKey()+":"+entry.getValue());
        }*/

        System.out.println(prop);
    }
}
